
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>加载江西地图 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-theme-vuejs/vue.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="LayerSwitcher.html" />
    
    
    <link rel="prev" href="initMap.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    文档信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="build.html">
            
                <a href="build.html">
            
                    
                    项目构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="link.html">
            
                <a href="link.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    基础使用
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="initMap.html">
            
                <a href="initMap.html">
            
                    
                    初始化地图
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.2" data-path="loadJXMap.html">
            
                <a href="loadJXMap.html">
            
                    
                    加载江西地图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="LayerSwitcher.html">
            
                <a href="LayerSwitcher.html">
            
                    
                    底图切换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="addPoints.html">
            
                <a href="addPoints.html">
            
                    
                    添加点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="addLine.html">
            
                <a href="addLine.html">
            
                    
                    添加线
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="addPolygon.html">
            
                <a href="addPolygon.html">
            
                    
                    添加面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="CustomCIrcle.html">
            
                <a href="CustomCIrcle.html">
            
                    
                    周边搜索圆
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    进阶
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="CoordsTransform.html">
            
                <a href="CoordsTransform.html">
            
                    
                    坐标转换
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    类说明
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="class.html">
            
                <a href="class.html">
            
                    
                    map
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >加载江西地图</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x52A0;&#x8F7D;&#x6C5F;&#x897F;&#x5730;&#x56FE;">&#x52A0;&#x8F7D;&#x6C5F;&#x897F;&#x5730;&#x56FE;</h1>
<blockquote>
<p>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#xFF1A;</p>
<ul>
<li>&#x914D;&#x7F6E;&#x9879;&#x76F8;&#x5173;,&#x8BE6;&#x89C1;&#x914D;&#x7F6E;&#x9879;&#x8BE6;&#x89E3;</li>
<li>&#x5730;&#x56FE;&#x4E2D;&#x5FC3;&#x70B9; <code>[115.92466595234826, 27.428038204473552]</code></li>
<li>&#x6295;&#x5F71;&#x5750;&#x6807;&#x7CFB;&#xFF08;projection&#xFF09;&#x4E3A; <code>EPSG:4326</code>&#x3002;</li>
<li>&#x5207;&#x7247;&#x539F;&#x70B9;&#xFF08;origin&#xFF09;&#x5FC5;&#x987B;&#x8BBE;&#x7F6E;&#x6B63;&#x786E;&#xFF0C;&#x6C5F;&#x897F;&#x4E3A; <code>[-400, 399.9999999999998]</code></li>
<li>&#x76F8;&#x5173;&#x56FE;&#x5C42;&#x914D;&#x7F6E;&#x89C1;&#x4E0B;&#x65B9;</li>
</ul>
</blockquote>
<h2 id="examples">Examples</h2>
<p><a href="../../example/loadJXMap.html">&#x52A0;&#x8F7D;&#x6C5F;&#x897F;&#x5730;&#x56FE;</a></p>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>&#x52A0;&#x8F7D;&#x6C5F;&#x897F;&#x5730;&#x56FE;&#xFF08;arcgis&#x670D;&#x52A1;&#xFF09;</title>
  <link rel="stylesheet" href="./lib/map/HMap.css" type="text/css">
  <script src="./lib/map/HMap.js"></script>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
  var cor = [
    {
      "level": 0,
      "resolution": 0.010986328383069278,
      "scale": 4617150
    },
    {
      "level": 1,
      "resolution": 0.005493164191534639,
      "scale": 2308575
    },
    {
      "level": 2,
      "resolution": 0.0027465809060368165,
      "scale": 1154287
    },
    {
      "level": 3,
      "resolution": 0.0013732916427489112,
      "scale": 577144
    },
    {
      "level": 4,
      "resolution": 6.866458213744556E-4,
      "scale": 288572
    },
    {
      "level": 5,
      "resolution": 3.433229106872278E-4,
      "scale": 144286
    },
    {
      "level": 6,
      "resolution": 1.716614553436139E-4,
      "scale": 72143
    },
    {
      "level": 7,
      "resolution": 8.582953794130404E-5,
      "scale": 36071
    },
    {
      "level": 8,
      "resolution": 4.291595870115493E-5,
      "scale": 18036
    },
    {
      "level": 9,
      "resolution": 2.1457979350577466E-5,
      "scale": 9018
    },
    {
      "level": 10,
      "resolution": 1.0728989675288733E-5,
      "scale": 4509
    },
    {
      "level": 11,
      "resolution": 5.363305107141452E-6,
      "scale": 2254
    },
    {
      "level": 12,
      "resolution": 2.681652553570726E-6,
      "scale": 1127
    }
  ];
  var resolutions = [];
  for (var i = 0; i < cor.length; i++) {
    resolutions.push(cor[i].resolution);
  }
  var Maps = new HMap.Map();
  Maps.initMap('map', {
    interactions: {
      altShiftDragRotate: true, // 是否允许`alt + shift`拖拽旋转（默认允许）
      doubleClickZoom: true, // 是否允许双击放大（默认允许）
      mouseWheelZoom: true, // 是否允许滚轮缩放（默认允许）
      shiftDragZoom: true,  // 是否允许`shift`加拖拽缩放（默认允许）
    },
    view: {
      center: [115.92466595234826, 27.428038204473552],
      resolutions: resolutions,
      fullExtent: [109.72859368643232, 24.010266905347684, 121.13105988819079, 30.76693489432357],
      tileSize: 256,
      origin: [-400, 399.9999999999998],
      enableRotation: true, // 是否允许旋转
      projection: 'EPSG:4326',
      rotation: 0,
      zoom: 1, // resolution
      zoomFactor: 2 // 用于约束分变率的缩放因子（高分辨率设备需要注意）
    },
    logo: {},
    baseLayers: [  // 不传时默认加载OSM地图。
      {
        layerName: 'vector',
        isDefault: true,
        layerType: 'TileXYZ',
        opaque: false, //图层是否不透明
        layerUrl: 'http://171.34.40.68:6080/arcgis/rest/services/JXMAP_2016_2/MapServer',
      }
    ]
  });
  console.log(Maps);
</script>
</body>
</html>

<hr>
<pre class="language-"><code class="lang-html"><span class="token doctype">&lt;!DOCTYPE html&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>en<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">charset</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>UTF-8<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">&gt;</span></span>&#x52A0;&#x8F7D;&#x6C5F;&#x897F;&#x5730;&#x56FE;&#xFF08;arcgis&#x670D;&#x52A1;&#xFF09;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>stylesheet<span class="token punctuation">&quot;</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>https://smilefdd.github.io/public/scripts/map/HMap.css<span class="token punctuation">&quot;</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>text/css<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>https://smilefdd.github.io/public/scripts/map/HMap.js<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>map<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>text/javascript<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
  var cor = [
    {
      &quot;level&quot;: 0,
      &quot;resolution&quot;: 0.010986328383069278,
      &quot;scale&quot;: 4617150
    },
    {
      &quot;level&quot;: 1,
      &quot;resolution&quot;: 0.005493164191534639,
      &quot;scale&quot;: 2308575
    },
    {
      &quot;level&quot;: 2,
      &quot;resolution&quot;: 0.0027465809060368165,
      &quot;scale&quot;: 1154287
    },
    {
      &quot;level&quot;: 3,
      &quot;resolution&quot;: 0.0013732916427489112,
      &quot;scale&quot;: 577144
    },
    {
      &quot;level&quot;: 4,
      &quot;resolution&quot;: 6.866458213744556E-4,
      &quot;scale&quot;: 288572
    },
    {
      &quot;level&quot;: 5,
      &quot;resolution&quot;: 3.433229106872278E-4,
      &quot;scale&quot;: 144286
    },
    {
      &quot;level&quot;: 6,
      &quot;resolution&quot;: 1.716614553436139E-4,
      &quot;scale&quot;: 72143
    },
    {
      &quot;level&quot;: 7,
      &quot;resolution&quot;: 8.582953794130404E-5,
      &quot;scale&quot;: 36071
    },
    {
      &quot;level&quot;: 8,
      &quot;resolution&quot;: 4.291595870115493E-5,
      &quot;scale&quot;: 18036
    },
    {
      &quot;level&quot;: 9,
      &quot;resolution&quot;: 2.1457979350577466E-5,
      &quot;scale&quot;: 9018
    },
    {
      &quot;level&quot;: 10,
      &quot;resolution&quot;: 1.0728989675288733E-5,
      &quot;scale&quot;: 4509
    },
    {
      &quot;level&quot;: 11,
      &quot;resolution&quot;: 5.363305107141452E-6,
      &quot;scale&quot;: 2254
    },
    {
      &quot;level&quot;: 12,
      &quot;resolution&quot;: 2.681652553570726E-6,
      &quot;scale&quot;: 1127
    }
  ];
  var resolutions = [];
  for (var i = 0; i &lt; cor.length; i++) {
    resolutions.push(cor[i].resolution);
  }
  var Maps = new HMap.Map();
  Maps.initMap(&apos;map&apos;, {
    interactions: {
      altShiftDragRotate: true, // &#x662F;&#x5426;&#x5141;&#x8BB8;`alt + shift`&#x62D6;&#x62FD;&#x65CB;&#x8F6C;&#xFF08;&#x9ED8;&#x8BA4;&#x5141;&#x8BB8;&#xFF09;
      doubleClickZoom: true, // &#x662F;&#x5426;&#x5141;&#x8BB8;&#x53CC;&#x51FB;&#x653E;&#x5927;&#xFF08;&#x9ED8;&#x8BA4;&#x5141;&#x8BB8;&#xFF09;
      mouseWheelZoom: true, // &#x662F;&#x5426;&#x5141;&#x8BB8;&#x6EDA;&#x8F6E;&#x7F29;&#x653E;&#xFF08;&#x9ED8;&#x8BA4;&#x5141;&#x8BB8;&#xFF09;
      shiftDragZoom: true,  // &#x662F;&#x5426;&#x5141;&#x8BB8;`shift`&#x52A0;&#x62D6;&#x62FD;&#x7F29;&#x653E;&#xFF08;&#x9ED8;&#x8BA4;&#x5141;&#x8BB8;&#xFF09;
    },
    view: {
      center: [115.92466595234826, 27.428038204473552],
      resolutions: resolutions,
      fullExtent: [109.72859368643232, 24.010266905347684, 121.13105988819079, 30.76693489432357],
      tileSize: 256,
      origin: [-400, 399.9999999999998],
      enableRotation: true, // &#x662F;&#x5426;&#x5141;&#x8BB8;&#x65CB;&#x8F6C;
      projection: &apos;EPSG:4326&apos;,
      rotation: 0,
      zoom: 1, // resolution
      zoomFactor: 2 // &#x7528;&#x4E8E;&#x7EA6;&#x675F;&#x5206;&#x53D8;&#x7387;&#x7684;&#x7F29;&#x653E;&#x56E0;&#x5B50;&#xFF08;&#x9AD8;&#x5206;&#x8FA8;&#x7387;&#x8BBE;&#x5907;&#x9700;&#x8981;&#x6CE8;&#x610F;&#xFF09;
    },
    logo: {},
    baseLayers: [  // &#x4E0D;&#x4F20;&#x65F6;&#x9ED8;&#x8BA4;&#x52A0;&#x8F7D;OSM&#x5730;&#x56FE;&#x3002;
      {
        layerName: &apos;vector&apos;,
        isDefault: true,
        layerType: &apos;TileXYZ&apos;,
        opaque: false, //&#x56FE;&#x5C42;&#x662F;&#x5426;&#x4E0D;&#x900F;&#x660E;
        layerUrl: &apos;http://171.34.40.68:6080/arcgis/rest/services/JXMAP_2016_2/MapServer&apos;,
      }
    ]
  });
  console.log(Maps);
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">&gt;</span></span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="initMap.html" class="navigation navigation-prev " aria-label="Previous page: 初始化地图">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="LayerSwitcher.html" class="navigation navigation-next " aria-label="Next page: 底图切换">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"加载江西地图","level":"1.4.2","depth":2,"next":{"title":"底图切换","level":"1.4.3","depth":2,"path":"LayerSwitcher.md","ref":"LayerSwitcher.md","articles":[]},"previous":{"title":"初始化地图","level":"1.4.1","depth":2,"path":"initMap.md","ref":"initMap.md","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","prism","theme-vuejs@git+https://github.com/pearofducks/gitbook-plugin-theme-vuejs.git","-fontsettings","-highlight","github","livereload"],"root":"./api","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/smileFDD/HMap.git"},"livereload":{},"search":{},"theme-vuejs":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"编辑此页","base":"https://github.com/smileFDD/HMap/tree/master/docs/api"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":">3.0.0"},"file":{"path":"loadJXMap.md","mtime":"2017-03-18T03:22:18.352Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-03-18T05:20:47.112Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    

    </body>
</html>

